package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._22享元模式._3网站;

import java.util.Hashtable;

public class Test {

    public static void main(String[] args) {

        WebSiteFactory f = new WebSiteFactory();

        WebSite fx = f.getWebSiteCategory("产品展示");  
        fx.use();

        WebSite fy = f.getWebSiteCategory("产品展示");
        fy.use();

        WebSite fz = f.getWebSiteCategory("产品展示");
        fz.use();

        WebSite fl = f.getWebSiteCategory("博客");
        fl.use();

        WebSite fm = f.getWebSiteCategory("博客");
        fm.use();

        WebSite fn = f.getWebSiteCategory("博客");
        fn.use();

        System.out.println("网站分类总数为:"+f.getWebSiteCount()); //统计实例化个数，结果应该为2
    }
}





